import React,{useState} from 'react'
import  ReactDOM  from 'react-dom';
export default function Count2(props) {
 console.log('----------render--------------');
 const [num,setNum]= useState(()=>{
    if(props.initCount<100){
        return props.initCount
    }else{
        return props.initCount+50
    }
  })
  return (
    <div>
        <div>{num}</div>
        <button onClick={()=>{
            
            setNum(num+1)
        }}>+</button>
    </div>
  )
}
